#ifndef _BUOLA_GUI_CPOINTER_H_
#define _BUOLA_GUI_CPOINTER_H_

#include <buola/gui.h>

namespace buola { namespace gui {

///\addtogroup gui
///@{

////////////////////////////////////////////////////////////////////////////

/// mouse cursor

///
///
///
////////////////////////////////////////////////////////////////////////////

class CPointer : public UShared
{
public:
    //! stock pointers
    enum EStock
    {
        STOCK_NOSTOCK=-1,
        STOCK_DEFAULT,
        STOCK_UP,
        STOCK_MOVE,
        STOCK_SIZENS,
        STOCK_SIZEWE,
        STOCK_SIZENESW,
        STOCK_SIZENWSE,
        STOCK_CROSS,
        STOCK_TEXT,
        STOCK_PEN,
        STOCK_HELP,
        STOCK_NO,
        STOCK_HAND,
        STOCK_COPY,
        STOCK_LINK,
        STOCK_VSPLIT,
        STOCK_HSPLIT,
        STOCK_INVISIBLE,

        STOCK_COUNT
    };

//! \name constructor and destructor
//@{
    CPointer()
        :   mInit(false)
    {}

    virtual ~CPointer();
//@}

public:
    //! create windowing-system cursor
    void Create(EStock pStock);
    //! create from image
    void Create(unsigned char*,unsigned char*,int,int,int);

    //! destroy
    void Destroy();

////////////////////////////////////////////
////////////////////////////////////////////
//////////////// internal //////////////////
////////////////////////////////////////////
////////////////////////////////////////////
public:
    //! return internal pixmap ID
    long GetID() {   return mCursor; }

    //! returns a stock cursor
    static PPointer GetStock(EStock);

private:
    bool mInit;

    long mCursor;        //!< internal pixmap ID

    static PPointer mStockCursors[STOCK_COUNT];
    static bool mStockCursorsInit;
};

///@}

/*namespace gui*/ } /*namespace buola*/ }

#endif
